<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('account',20);
            $table->string('name',20);
            $table->string('password',100);
            $table->string('md5_password',100)->nullable();
            $table->string('email',50)->nullable();
            $table->integer('type');
            $table->string('chain_code',20)->nullable();
            $table->integer('cinema_id')->nullable();
            $table->string('cinema_code',20)->nullable();
            $table->integer('remember_token')->default(0);
            $table->integer('sex')->nullable();
            $table->string('phone',20)->nullable();
            $table->string('position',20)->nullable();
            $table->string('department',20)->nullable();
            $table->string('public_key',300)->nullable();
            $table->integer('is_manager')->default(0);
            $table->integer('status')->default(1);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
